Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing /
Chapter 4 - Advanced Printing Features / Advanced Printing Features Reference
Functions / Working With QuickDraw GX Print Files


GXReadPrintFilePage

You can use the GXReadPrintFilePage function to retrieve a page or page format for a print file object.

void GXReadPrintFilePage (gxPrintFile aPrintFile, long pageNumber,
                     long numViewPorts, gxViewPort *viewPortList, 
                     gxFormat *pageFormat, gxShape *pageShape);
aPrintFile

A reference to the print file object whose file you want to access.
pageNumber

The page you want to access.
numViewPorts

The number of view ports in the view port list.
viewPortList

A pointer to a list of references to view ports through which you want the page's picture shape to draw.
pageFormat

On return, a reference to the format object associated with the page.
pageShape
On return, a reference to the picture shape that contains the page's data.
DESCRIPTION
The GXReadPrintFilePage function retrieves the print file object's page that you specify in the pageNumber parameter. It returns the page format and a picture shape representing the contents of the page in the pageFormat and pageShape parameters, respectively. You can set one or both of these parameters to nil if you do not want them returned.

The page shape is associated with the view ports in the viewPortList list parameter, which is the list of view ports you want the shape to be drawn through when you call GXDrawShape for the shape in the pageShape parameter. The numViewPorts parameter specifies how many view ports are in the list.

SPECIAL CONSIDERATIONS
Do not change the page format or page shape, pointed to by the pageFormat and pageShape parameters, directly. If you want to change the format or shape, make a copy of the format or shape and modify the copy. After you make a change to the copy, you can replace the format or page in the print file with your copy or insert your copy into the print file.

For speed and memory efficiency, dispose of the references to the format and page shape objects as soon as they are no longer needed. For example, dispose of them as soon as you make a copy of them or draw a page with them.

The page number specified in the pageNumber parameter must be valid. Call the GXCountPrintFilePages function to ensure that the page number is valid.

RESULT CODES
gxSegmentLoadFailedErrA required code segment could not be found, or there was not enough memory to load it.
SEE ALSO
For an example that uses the GXReadPrintFilePage function, see "Reading Print File Data" on page 4-30.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help